using System;
using Slobby.Common;
using Slobby.SharedNetworkTypes;

namespace Slobby.Client.Net {
    class PreAuthReciever : Reciever {
        ServerConnection conn;

        public PreAuthReciever(ServerConnection connection) {
            conn = connection;
        }

        public void Recieve(PassedAuthenticationMessage passauth) {
            conn.PassAuth();
        }

        public void Recieve(VersionMessage expectedversion) {
            conn.FailAuth("Client version does not match the server's, please use version " + expectedversion.ToVersion().ToString(3));
        }

        public override void Default(object o) {
            // ignore everything else
        }
    }
}
